package com.platform.util;

import java.util.Arrays;

/**
 * @program:
 * @Description:
 * @Author: liweihai
 * @Date: Created in 2019/1/12 16:22
 */
public enum CateTypeEnum {
    ORDER_NO(0, "出错了"),
    COIN_TYPE_REG(1, "Banner"),
    COIN_TYPE_EX(2, "分类"),
    COIN_TYPE_CONSUME(3, "活动广告"),
    COIN_TYPE_EXD(4, "人气榜"),
    COIN_TYPE_REG_USER(5, "社区精选"),
    COIN_TYPE_ADV(6,"爆款大牌"),
    COIN_TYPE_REC(7,"推荐单品"),
    COIN_TYPE_HOT(8,"热门推荐");
    private int key;
    private String value;

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    CateTypeEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getDesc(int key) {

        CateTypeEnum result = Arrays.stream(CateTypeEnum.values()).filter(state -> state.getKey() == key).findFirst().orElse(CateTypeEnum.ORDER_NO);
        return result.getValue();

    }
}